package com.server.file.utils;


import com.server.file.model.common.CommonModel;

import java.util.Date;

/**
 * Created by wangtao on 2018/3/13.
 */
public class BusinessUtil {

    /**
     * 公共属性绑定
     * @param model
     */
    public static void appendRecord(CommonModel model) {
        if(model.getCreationTime() != null){
            model.setUpdateTime(new Date());
            model.setUpdateMethod("system");
        }else{
            model.setCreationTime(new Date());
            model.setCreationMethod("system");
            model.setUpdateMethod(null);
            model.setUpdateTime(null);
            model.setUpdatedBy(null);
            model.setDeleteFlag(0);
        }
    }
}
